// export default {
//     deepClone: (targetObj) => {
//         if (typeof targetObj !== 'object') return targetObj
//         let obj = targetObj.constructor === Array ? [] : {}
//         for (const key in obj) {
//             if (obj[key] && obj.hasOwnProperty(key)) {
//                 if (typeof obj[key] === 'object') {
//                     obj[key].constructor === Array ? [] : {}
//                     obj[key] = deepClone(targetObj[key])
//                 } else {
//                     obj[key] = targetObj[key]
//                 }
//             }
//         }
//         return obj
//     }
// }

console.log(`----------------------- module -----------------------`)

export const deepClone =  (targetObj) => {
    if (typeof targetObj !== 'object') return targetObj
    let obj = targetObj.constructor === Array ? [] : {}
    for (const key in targetObj) {
        if (targetObj[key] && targetObj.hasOwnProperty(key)) {
            if (typeof targetObj[key] === 'object') {
                obj[key] = targetObj[key].constructor === Array ? [] : {}
                obj[key] = deepClone(targetObj[key])
            } else {
                obj[key] = targetObj[key]
            }
        }
    }
    return obj
}